#!/usr/bin/env python
# -*- coding=utf-8 -*-

import os
import functools
import time

def make_bold(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        print "call"
        return '<b> {} </b>'.format(func(*args, **kwargs))
    return wrapper

@make_bold
def test(a, b = "xxx"):
    return "Hello world {0} {1}".format(a, b)

def make_header(level):

    def decorator(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            return '<h{0}> {1} </h{0}>'.format(level, func(*args, **kwargs))
        return wrapper
    return decorator

@make_header(2)
def test1(a, b = "xxx"):
    return "Hello world {0} {1}".format(a, b)



print test(a = '0', b = 'ee')
print test.__name__, test.__doc__
print test1(a = '0', b = 'ee')
print test1.__name__, test1.__doc__

while 1:
    time.sleep(5)
